<template>
  <UploadFile
    :file-list="props.fileList"
    :base-api="VITE_GLOB_API_URL"
    v-bind="props"
    @change="mychange"
    @update:fileList="changeFileList"
  >
    <template v-if="$slots.default" #default="{ data }">
      <slot :data="data"></slot>
    </template>
  </UploadFile>
</template>

<script lang="ts" setup>
import UploadFile from './uploadAndPreview/UploadFile.vue'
import { getAppEnvConfig } from '@@/utils/env'

const emits = defineEmits(['mychange', 'update:fileList'])

const props = defineProps([
  'fileList',
  'isBigFile',
  'disabled',
  'showFileList',
  'types',
  'btnName',
  'buttonGhost',
  'buttonBlock',
  'size',
  'limit',
  'listType',
  'savePath',
  'imgFileId',
  'bucket'
])
const { VITE_GLOB_API_URL } = getAppEnvConfig()

function mychange(file) {
  emits('mychange', file)
}

function changeFileList(fileList) {
  emits('update:fileList', fileList)
}
</script>

<style lang="less"></style>
